package com.tobe.spring_demo.lifecycle;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.tobe.spring_demo.mybatis.mapper.MyInterface;

/**
 * @author yangqifan 2015年9月10日
 * 
 */
public class LifecycleTest {
	
	public static void main(String[] args) {
		//appcontext, spring容器上下文,解析xml配置创建bean容器, 
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-config-lifecycle.xml");
		
		context.getBean(LFTwo.class);
		context.registerShutdownHook();
		context.close();
		
		try {
			Thread.sleep(100000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
	}

}

